package itdep.services.address;

import ga.domain.repository.EntityCriteria;
import ga.domain.repository.GenericEntityFilterProcessor;
import itdep.domain.address.Settlement;

/**
 * @author Ivan Khalopik
 * @version $Revision: 42 $ $Date: 2010-06-25 09:12:54 +0000 (Fri, 25 Jun 2010) $
 */
public class SettlementFilterProcessor extends GenericEntityFilterProcessor<Settlement, SettlementFilter> {

	public SettlementFilterProcessor() {
		super(Settlement.class);
	}

	@Override
	protected void processFilter(EntityCriteria criteria, SettlementFilter filter) {
		if (filter.getDistrict() != null) {
			criteria.add(criteria.getProperty(Settlement.DISTRICT_PROPERTY).eq(filter.getDistrict()));
		}
	}
}
